package cn.cloudreal.cbms.resmonitor.dao;

import java.util.List;
import java.util.Map;

import cn.cloudreal.cbms.common.util.PageBean;
import cn.cloudreal.cbms.vo.FundBudget;
import cn.cloudreal.cbms.vo.Mediasumm;
import cn.cloudreal.cbms.vo.PutInPlanMonth;
import cn.cloudreal.cbms.vo.ResourceMonitor;
import cn.cloudreal.cbms.vo.SourcePlanYear;

/**
 * <p>
 * Title: ITC
 * </p>
 * <p>
 * Description:资源监控dao层类
 * </p>
 * <p>
 * Copyright: Copyright (c) 2010
 * </p>
 * <p>
 * Company:云恒瑞通
 * </p>
 * 
 * @author 夏加冬
 * @date 2012-7-9
 */
public interface ResMonitorDao
{
    /**
     * 查询列表数据
     * 
     * @param page
     * @return
     */
    @SuppressWarnings("unchecked")
    public List<ResourceMonitor> getMediaSummaries(PageBean page, Map map);

    /**
     * 根据合同年份查询对应的媒体list
     * 
     * @param year
     * @return
     */
    public List<Mediasumm> getMediaSummariesByYear(int year,
            String mediaName,
            String city);

    /**
     * 添加预算（年）
     */
    public int saveSourcePlanYear(SourcePlanYear sourcePlanYear);
    
    
    /**
     * 添加预算(月)
     */
    public void savePutInPlanMonth(PutInPlanMonth putInPlanMonth);
    
    /**
     * 资源监控媒体计划投放量录入
     * 
     * @param page
     * @return null
     */
    public Integer addResMonitorRelatoin(List<PutInPlanMonth> putInPlanMonths,
            SourcePlanYear sourcePlanYear,int m );
    
    /**
     * 资源监控媒体计划投放量更新
     * 
     * @param page
     * @return null
     */
    public void updateResMonitorRelatoin(List<PutInPlanMonth> putInPlanMonths,SourcePlanYear sourcePlanYear);

    /**
     * 查找年度资源投放计划
     * 
     * @return SourcePlanYear
     */
    public SourcePlanYear getSourcePlanYear(Integer sourceId);
    
    /**
     * 获取分阶段投放计划
     * @return list
     */
    public List<PutInPlanMonth>getPutInPlanMonths(String idPrice,String costType,String costSubType);

    /**
     * 获取年度投放计划
     * @return list
     */
    public SourcePlanYear getSourceIsExist(String id_price,String costType,String costSubType);
    /**
     * 获取费用预算
     * @return list
     */
    public FundBudget getFundBudgetIsExist(String year,String city,String costType,String costSubType);
    
    /**
     * 查找预算（月）是否存在
     */
    public List<PutInPlanMonth> findPutMonthByNowTotalPutInAndType(PutInPlanMonth putInPlanMonth);
    
    public void addResMonitorRelatoin_01(List<PutInPlanMonth> putInPlanMonths, SourcePlanYear sourcePlanYear, int m);
}
